package components;

import java.io.IOException;

import logger.Log;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import componentsAbstract.InputCompAbstract;

public class TextBox extends InputCompAbstract { 


	public TextBox(WebDriver driver, By fieldName) {
		launchLog();
		this.driver = driver;
		this.fieldName = fieldName;
		//fieldObject = driver.findElement(fieldName);
		this.classInfo = this.getClass().getCanonicalName();
	}
	
	public TextBox(WebDriver driver,By fieldName, String fieldValue) {
		launchLog();
		this.driver = driver;
		this.fieldName = fieldName;
		//fieldObject = driver.findElement(fieldName);
		this.classInfo = this.getClass().getCanonicalName();
		this.setFieldValue(fieldValue);
	}
	
	
	private void launchLog()
	{
		try {
			if(log == null)
			{
				log = new Log(this.getClass());
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	

	

}
